package com.david.musicapp

import android.app.Application
import com.david.core.utils.PreferenceUtils

class MusicApplication :Application(){
    var createTime = 0L

    override fun onCreate() {
        super.onCreate()
        instance = this

//        UrlConstant.BASE_URL = "https://divaid.github.io"//TODO 资源从gitee上获取（在gitee上部署服务）

//        registerHeadsetPlugReceiver()

        createTime = System.currentTimeMillis()

        PreferenceUtils.context = this
    }

    companion object{
        private var instance: MusicApplication? = null
        fun instance() = instance!!

    }


    private fun registerHeadsetPlugReceiver() {
//        val headsetPlugReceiver = HeadsetPlugReceiver()
//        val intentFilter = IntentFilter()
//        intentFilter.addAction("android.intent.action.HEADSET_PLUG")
//        registerReceiver(headsetPlugReceiver, intentFilter)
    }
}